<?php
/**
 * File renderer.
 *
 * @package ElggFile
 */
$full = elgg_extract ( 'full_view', $vars, FALSE );
$award = elgg_extract ( 'entity', $vars, FALSE );
$base_url = elgg_get_site_url () . "resumes";

$title = $award->title;
$description = $award->description;

$file = get_entity ( $award->file_guid );
if($file){
	$icon = elgg_view_entity_icon($file, 'small');
	$link = $file->getURL();
} else {
	$link = $award->getURL();
}

if ($award->canEdit ( elgg_get_logged_in_user_guid () )) {
	$del_url = "$base_url/delaward/{$award->getGUID()}";
	$del_url = elgg_add_action_tokens_to_url ( $del_url );
	$del_confirm = elgg_echo ( 'submana:delete' );

	$edit_url = "$base_url/editaward/{$award->getGUID()}";
	$edit_url = elgg_add_action_tokens_to_url ( $edit_url );
	$edit_label = elgg_echo ( 'submana:edit' );

	$edit_del_url = "<div class='right'>
	<ul class='elgg-menu elgg-menu-entity elgg-menu-hz elgg-menu-entity-default'>
	<li class='elgg-menu-item-edit'><a href='$edit_url'>$edit_label</a></li>
	<li class='elgg-menu-item-delete'><a href='$del_url'
	rel='$del_confirm'
	class='elgg-requires-confirmation'><span
	class='elgg-icon elgg-icon-delete '></span></a></li>
	</ul>
	</div>";
}


echo <<<___HTML
$edit_del_url
<div>
	$icon <a href="$link">$title</a>
</div>
<div>
	$description
</div>
___HTML;

?>
